<nz-modal [(nzVisible)]="Visible" [nzBodyStyle]="{'padding':'10px 24px'}" [nzWidth]="600" nzTitle="新增作业"
    [nzFooter]="modalFooter" (nzOnCancel)="Cancel()">
    <div *ngIf="!editStatus">请选择一条作业项目：</div>
    <div *ngIf="!editStatus" style="margin-top:5px">
        <nz-tree-select [nzDropdownStyle]="treeNodeStyle" style="width: 400px" [nzNodes]="workData" nzShowSearch
            [(ngModel)]="workId">
        </nz-tree-select>
        <button nz-button nzType="primary" (click)="edit()" nzGhost style="margin-left:10px"><i nz-icon
                nzType="plus"></i>新增作业项目</button>
    </div>

    <div *ngIf="editStatus">
        <button nz-button nzType="primary" (click)="back()" nzGhost><i nz-icon nzType="rollback"></i>返回</button>

        <nz-descriptions nzBordered [nzSize]="'small'" [nzColumn]="{ xxl: 1, xl: 1, lg: 1, md: 1, sm: 1, xs: 1 }"
            style="margin-top:10px">
            <nz-descriptions-item nzTitle="作业项目名称">
                <input nz-input [(ngModel)]="workList.name" class="w95" />
                &nbsp;<span class="red">*</span>
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="作业类型">
                <nz-select [(ngModel)]="workList.type" class="w95">
                    <nz-option *ngFor="let item of typeData" [nzValue]="item.value" [nzLabel]="item.label"></nz-option>
                </nz-select>
                &nbsp;<span class="red">*</span>
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="设备类型及分级">
                <nz-tree-select [nzMultiple]="true" [nzDropdownStyle]="treeNodeStyle" style="width:95%;height:60px"
                    [nzNodes]="gradeData" [(ngModel)]="workList.grade">
                </nz-tree-select>
                &nbsp;<span class="red">*</span>
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="周期">
                <nz-select [(ngModel)]="workList.circle" (ngModelChange)="countcircleChange($event)" class="w95">
                    <nz-option *ngFor="let item of circle" [nzValue]="item.value" [nzLabel]="item.label"></nz-option>
                </nz-select>
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="次数">
                <input nz-input [(ngModel)]="workList.count" (ngModelChange)="countcircleChange($event)" class="w95" />
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="周期描述">
                <input nz-input [(ngModel)]="workList.desc" class="w95" />
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="单位">
                <input nz-input [(ngModel)]="workList.unit" class="w95" />
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="单位工时（分钟）">
                <input nz-input [(ngModel)]="workList.unitTime" class="w95" />
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="是否上道">
                <nz-radio-group [(ngModel)]="workList.topway">
                    <label nz-radio nzValue="1">是</label>
                    <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
            </nz-descriptions-item>
            <nz-descriptions-item nzTitle="是否天窗">
                <nz-radio-group [(ngModel)]="workList.skylight">
                    <label nz-radio nzValue="1">是</label>
                    <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
            </nz-descriptions-item>
        </nz-descriptions>
    </div>

    <ng-template #modalFooter>
        <button *ngIf="!editStatus" nz-button nzType="default" (click)="Cancel()">取消</button>
        <button *ngIf="!editStatus" nz-button nzType="primary" (click)="Ok()">确定</button>

        <button *ngIf="editStatus" nz-button nzType="primary" (click)="saveAll('0')">保存到作业项目</button>
        <button *ngIf="editStatus" nz-button nzType="primary" (click)="saveAll('1')">保存并纳入年表</button>
    </ng-template>
</nz-modal>